package com.pvdnc.dxhook;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonUtils {
    private static Gson getGson(){
        GsonBuilder builder=new GsonBuilder();
        builder.disableHtmlEscaping();
        return builder.create();
    }
    public static <T> String toJson(T obj){
        return getGson().toJson(obj);
    }

    public static <T> T fromJson(String json,Class<T> cls){
        return getGson().fromJson(json, cls);
    }
}
